<template>
  <div class="knowledge-container">
    <h1 class="page-title">已加入课程</h1>
    
    <div class="course-cards">
      <!-- 课程卡片1 -->
      <div class="course-card">
        <div class="card-header" style="background: linear-gradient(135deg, #8b5cf6, #ec4899)">
          <div class="decorations">
            <div class="circle"></div>
            <div class="line"></div>
          </div>
        </div>
        <div class="card-content">
          <h3 class="course-name">思维创新与开发</h3>
          <p class="course-term">第2学期</p>
          <p class="course-teacher">董文良</p>
      <p class="course-id">130025 - 022</p>
          <button class="start-btn" @click="$router.push('/knowledge-graph')">开始学习</button>
        </div>
      </div>

      <!-- 课程卡片2 -->
      <div class="course-card">
        <div class="card-header" style="background: linear-gradient(135deg, #8b5cf6, #ec4899)">
          <div class="decorations">
            <div class="circle"></div>
            <div class="line"></div>
          </div>
        </div>
        <div class="card-content">
          <h3 class="course-name">宇宙探索基础</h3>
          <p class="course-term">第1学期</p>
          <p class="course-teacher">刘宇航</p>
          <p class="course-id">130026 - 011</p>
          <button class="start-btn" @click="$router.push('/course-detail')">开始学习</button>
        </div>
      </div>

      <!-- 课程卡片3 -->
      <div class="course-card">
        <div class="card-header" style="background: linear-gradient(135deg, #8b5cf6, #ec4899)">
          <div class="decorations">
            <div class="circle"></div>
            <div class="line"></div>
          </div>
        </div>
        <div class="card-content">
          <h3 class="course-name">星际生物科学</h3>
          <p class="course-term">第3学期</p>
          <p class="course-teacher">张生物</p>
          <p class="course-id">130027 - 033</p>
          <button class="start-btn">开始学习</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
// 后续可添加数据获取逻辑
</script>

<style scoped>
.knowledge-container {
  padding: 2rem;
  /* background-color: #1a1a1a; */
  min-height: calc(100vh - 70px);
}

.page-title {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: 24px;
  /* color: white; */
  margin-bottom: 2rem;
}

.course-cards {
  display: flex;
  gap: 2rem;
}

.course-card {
  width: 320px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease; /* 添加过渡动画 */
}

.course-card:hover {
  transform: translateY(-5px); /* 悬停时向上偏移 */
  box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4), 0 0 0 2px rgba(99, 102, 241, 0.3);}

.card-header {
  height: 120px; /* 调整为卡片高度的1/3 */
  position: relative;
  background: linear-gradient(90deg, #8b5cf6 0%, #ec4899 100%) !important;
}

.decorations {
  position: absolute;
  width: 100%;
  height: 100%;
}

/* 左侧大圆形 */
.circle {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  top: 20px;
  left: 20px;
}

/* 右侧小圆形 */
.circle.small {
  width: 50px;
  height: 50px;
  top: 40px;
  left: auto;
  right: 30px;
}

/* 交叉线条 */
.line {
  position: absolute;
  width: 100px;
  height: 2px;
  background: rgba(240,240,240,0.3);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(30deg);
}

.line.second {
  transform: translate(-50%, -50%) rotate(-30deg);
}

.card-content {
  background: white;
  padding: 1.5rem;
  min-height: 200px;
}

.decorations {
  position: absolute;
  width: 100%;
  height: 100%;
}

.circle {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  top: 20px;
  left: 20px;
}

.line {
  position: absolute;
  width: 100px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  bottom: 30px;
  right: 20px;
  border-radius: 2px;
}

.course-name {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #111;
  margin-bottom: 0.75rem;
}

.course-term,
.course-teacher,
.course-id {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: #666;
  margin-bottom: 0.5rem;
}

.start-btn {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #3b82f6;
  background: transparent;
  border: 2px solid #3b82f6;
  border-radius: 8px;
  padding: 8px 16px;
  margin-top: 1rem;
  cursor: pointer;
  float: right;
  transition: all 0.3s ease;
}

.start-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

.course-id::before {
  content: "编号：";
}
</style>
